using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableReview
	{
		public const string Table = "Review";
		public const string ReviewID = "ReviewID";
		public const string ObjectID = "ObjectID";
		public const string TypeID = "TypeID";
		public const string MemberID = "MemberID";
		public const string MemberName = "MemberName";
		public const string Content = "Content";
		public const string IsShow = "IsShow";
		public const string ReviewTime = "ReviewTime";
	}
	
	[Serializable]
	public class BaseReview
		: IDbSessionEntity, IJsonClass
	{
		int m_ReviewID;
		/// <summary>
        /// 
        /// </summary>
        public int ReviewID
        {
            get { return m_ReviewID; }
            set { m_ReviewID = value; }
        }
		
		int m_ObjectID;
		/// <summary>
        /// 
        /// </summary>
        public int ObjectID
        {
            get { return m_ObjectID; }
            set { m_ObjectID = value; }
        }
		
		int m_TypeID;
		/// <summary>
        /// 
        /// </summary>
        public int TypeID
        {
            get { return m_TypeID; }
            set { m_TypeID = value; }
        }
		
		int m_MemberID;
		/// <summary>
        /// 
        /// </summary>
        public int MemberID
        {
            get { return m_MemberID; }
            set { m_MemberID = value; }
        }
		
		string m_MemberName;
		/// <summary>
        /// 
        /// </summary>
        public string MemberName
        {
            get { return m_MemberName; }
            set { m_MemberName = value; }
        }
		
		string m_Content;
		/// <summary>
        /// 
        /// </summary>
        public string Content
        {
            get { return m_Content; }
            set { m_Content = value; }
        }
		
		int m_IsShow;
		/// <summary>
        /// 
        /// </summary>
        public int IsShow
        {
            get { return m_IsShow; }
            set { m_IsShow = value; }
        }
		
		DateTime? m_ReviewTime;
		/// <summary>
        /// 
        /// </summary>
        public DateTime? ReviewTime
        {
            get { return m_ReviewTime; }
            set { m_ReviewTime = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_ReviewID = reader[TableReview.ReviewID];
            m_ObjectID = reader[TableReview.ObjectID];
            m_TypeID = reader[TableReview.TypeID];
            m_MemberID = reader[TableReview.MemberID];
            m_MemberName = reader[TableReview.MemberName];
            m_Content = reader[TableReview.Content];
            m_IsShow = reader[TableReview.IsShow];
            m_ReviewTime = reader[TableReview.ReviewTime];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableReview.ReviewID, PrimaryKeyType.Identity, ReviewID);
			writer[TableReview.ObjectID] = ObjectID;
			writer[TableReview.TypeID] = TypeID;
			writer[TableReview.MemberID] = MemberID;
			writer[TableReview.MemberName] = MemberName;
			writer[TableReview.Content] = Content;
			writer[TableReview.IsShow] = IsShow;
			writer[TableReview.ReviewTime] = ReviewTime;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_ReviewID = idd;
        }
		
		public string TableName
        {
            get { return TableReview.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_ReviewID = hashToRead["ReviewID"];
			 
             m_ObjectID = hashToRead["ObjectID"];
			 
             m_TypeID = hashToRead["TypeID"];
			 
             m_MemberID = hashToRead["MemberID"];
			 
             m_MemberName = hashToRead["MemberName"];
			 
             m_Content = hashToRead["Content"];
			 
             m_IsShow = hashToRead["IsShow"];
			 
             m_ReviewTime = hashToRead["ReviewTime"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["ReviewID"] = ReviewID;
			 
            hashToFill["ObjectID"] = ObjectID;
			 
            hashToFill["TypeID"] = TypeID;
			 
            hashToFill["MemberID"] = MemberID;
			 
            hashToFill["MemberName"] = MemberName;
			 
            hashToFill["Content"] = Content;
			 
            hashToFill["IsShow"] = IsShow;
			 
            hashToFill["ReviewTime"] = ReviewTime;
			 
        }

        #endregion
		
	}
}
